[Unit]
Description={{ service_name }} service
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
{% if MemoryLimit|default("") %}
MemoryLimit={{ MemoryLimit }}
{% endif %}
{% if CPUQuota|default("") %}
CPUQuota={{ CPUQuota }}
{% endif %}
{% if IOReadBandwidthMax|default("") %}
IOReadBandwidthMax={{ IOReadBandwidthMax }}
{% endif %}
{% if IOWriteBandwidthMax|default("") %}
IOWriteBandwidthMax={{ IOWriteBandwidthMax }}
{% endif %}
LimitNOFILE=1000000
#LimitCORE=infinity
LimitSTACK=10485760
User={{ deploy_user }}
ExecStart={{ deploy_dir }}/scripts/run_{{ this_role_name }}.sh
{% if restart|default(false) %}
Restart={{ restart }}
{% else %}
Restart=always
{% endif %}
RestartSec=15s
{% if disable_send_sigkill|default(false) %}
SendSIGKILL=no
{% endif %}

[Install]
WantedBy=multi-user.target
